package cn.xiaobai.enums;

/**
 * 工具状态
 *
 * @Author yangdaji
 * @Date 2023/12/11
 * @PackageName cn.xiaobai.enums
 * @ClassName PluginState
 */
public enum ToolState {
    RUNNING(0, "运行中"),
    START(1, "启动中"),
    STOP(2, "停止"),
    INIT(3, "初始化");

    /**
     * id
     */
    private Integer id;

    /**
     * 名称
     */
    private String name;

    ToolState(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public static ToolState getState(Integer state) {
        for (ToolState value : values()) {
            if (value.getId().equals(state)) {
                return value;
            }
        }
        return STOP;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
